package com.jaws.core.configuration;

import java.util.List;

import lombok.Data;

import org.springframework.boot.context.properties.ConfigurationProperties;

import com.jaws.core.common.enums.SnowflakeModeEnum;

/**
 * common配置类
 * 
 * @author maojian
 * @date 2018-03-12 08:56:12
 * @since v1.0.0
 */
@ConfigurationProperties(prefix = CommonProperties.COMMON_PREFIX)
@Data
public class CommonProperties {

	public static final String COMMON_PREFIX = "jaws.common";

	private SnowflakeModeEnum snowflakeMode;

	private Integer snowflakeWorkerId;

	private Integer snowflakeCenterId;
	
	private boolean snowflakeK8s = false;

	private String logSensSwitch = "off";

	private String logSensPath;

	private List<LogSens> logSens;

	private JawsTaskExecutor taskExecutor = new JawsTaskExecutor();

	private JawsRedis redis;

	@Data
	public static class JawsTaskExecutor {
		private int corePoolSize = 5;
		private int maxPoolSize = 10;
		private int queueCapacity = 100;
		private String threadNamePrefix = "jaws-thread-";
	}

	@Data
	public static class LogSens {
		private Class<?> excludeClass;
	}

	@Data
	public static class JawsRedis {
		private int maxKeyLength;
		private String prefix;
	}

}
